package ess.control;

public class FloorRequest {

	int floor;
	int requestDirection; //Direction.UP or Direction.DOWN
	int assignedElevatorId;
	
	public FloorRequest(int floor, int requestDirection)
	{
		this.floor = floor;
		this.requestDirection = requestDirection;
		assignedElevatorId = -1;
	}
	
	int getFloor(){
		return floor;
	}
	
	int getRequestDirection(){
		return requestDirection;
	}
	
	public int getAssignedElevatorId()
	{
		return assignedElevatorId;
	}
	
	public void setAssignedElevator(int id){
		assignedElevatorId = id;
	}
	
	public boolean isAssigned(){
		return assignedElevatorId != -1;
	}
	
	public void resetAssignment(){
		assignedElevatorId = -1;
	}
	
	public boolean equals(Object obj) {
		FloorRequest req = (FloorRequest) obj;
		if(req.getFloor() == floor && req.getRequestDirection() == requestDirection)
			return true;
		return false;
	}
}
